j = 0
for year in range(2001,2101):
    if (year%4==0 and year %100 !=0) or (year%400==0):
        print(year,end=' ')
        j += 1
        if j % 10 == 0:
            print()